home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / atre27.exe / ATREE_27 / EXAMPLE2.LF < prev    next >
Text File  |  1992-08-01  |  3KB  |  88 lines

  1. #
  2. #
  3. #---- example2.lf
  4. #!!!! requires example1.lf to be run first !!!!
  5. #
  6. #---- This is an lf example that tests both the XOR, NXOR,
  7. #---- and AND functions of two binary inputs learned in
  8. #---- example1.lf.
  9. #---- The trees saved into the file example1.tre are used with
  10. #---- the encodings from the file example1.cod.
  11. #---- Note that a saved set of trees must be accompanied
  12. #---- by its corresponding encodings if the tree is to function
  13. #---- properly in future trials where the trees are loaded
  14. #---- instead of generated.
  15. #
  16.  
  17. #---- specify tree statements
  18. tree
  19.  
  20. #---- test on trees generated in example1.lf
  21.     load tree from "example1.tre"
  22.  
  23. #---- specify function statements
  24. function
  25.  
  26. #---- domain dimension must be the first statement, followed
  27. #---- by the codomain dimension
  28.     domain dimension = 2
  29.  
  30. #---- we are testing on 3 functions at once, XOR, NXOR, and AND
  31. #---- which means there are 3 codimensions
  32.     codomain dimension = 3
  33.  
  34. #---- load encoding generated in example1.lf for use with example1.tre
  35.     load coding from "example1.cod"
  36.  
  37. #---- there are no rows in our training set
  38. #---- note that there is NO "training set =" statement
  39. training set size = 0
  40.  
  41. #---- we will test on the following 4 vectors
  42.     test set size = 4
  43.     test set =
  44. # A B   A xor B A nxor B    A and B
  45.   1 1      0       1           1
  46.   1 0      1       0           0
  47.   0 1      1       0           0
  48.   0 0      0       1           0
  49.  
  50. #---- The following output file should be generated:
  51. #---- The first line indicates how many codomains there are.
  52. #---- The next four lines represent each of the four lines in the test set.
  53. #---- Each value is followed by its corresponding quantization number
  54. #---- in the prescribed encoding scheme.  Each codomain is followed
  55. #---- by the corresponding result from the ALN's, along with its quantization 
  56. #---- number.  Remember, it's not the calculated value that is as important
  57. #---- as the calculated quantization level.  You can get more accurate values
  58. #---- by tightening up the encoding: increasing the number of quantization 
  59. #---- levels.
  60.  
  61. #---- After the results is the error histogram, which counts for each 
  62. #---- of the codomains the number of times the result quantization 
  63. #---- level differed from the actual quantization level by n.  In this example,
  64. #---- the ALN's executed the test set perfectly, so there are 4 counts for
  65. #---- errors of n = 0 in each of the 3 codomains.
  66.  
  67.  
  68. #  A            B       A xor B  A xor B result  A nxor B A nxor B result A and B  A and B result
  69.  
  70. #3
  71. #1.000000 1 1.000000 1  0.000000 0  0.000000 0  1.000000 1  1.000000 1  1.000000 1  1.000000 1
  72. #1.000000 1 0.000000 0  1.000000 1  1.000000 1  0.000000 0  0.000000 0  0.000000 0  0.000000 0
  73. #0.000000 0 1.000000 1  1.000000 1  1.000000 1  0.000000 0  0.000000 0  0.000000 0  0.000000 0
  74. #0.000000 0 0.000000 0  0.000000 0  0.000000 0  1.000000 1  1.000000 1  0.000000 0  0.000000 0
  75. #
  76. #ERROR HISTOGRAM
  77. #0 errors       4   4   4
  78. #1 errors       0   0   0
  79. #2 errors       0   0   0
  80. #3 errors       0   0   0
  81. #4 errors       0   0   0
  82. #5 errors       0   0   0
  83. #6 errors       0   0   0
  84. #7 errors       0   0   0
  85. #8 errors       0   0   0
  86. #9+ errors      0   0   0
  87.